<template>
  <div>
    <div class="actions">
      <template v-for="(button, index) in buttons" :key="index">
        <el-button :type="button.type || 'default'" @click="button.click">
          {{ button.text }}
        </el-button>
      </template>
    </div>

    <!-- <div v-if="showSearch" class="search-box ml-auto">
      <el-input
        v-model="searchQuery"
        :placeholder="searchPlaceholder"
        class="w-64"
        clearable
        @input="handleSearch"
      >
        <template #suffix>
          <el-icon><Search /></el-icon>
        </template>
      </el-input>
    </div> -->
  </div>
</template>

<script setup>
  // 接收传过来的参数
  defineProps({
    buttons: {
      type: Array,
      default: () => []
    }
    // searchPlaceholder: {
    //     type: String,
    //     default: ''
    // },
    // showSearch: {
    //     type: Boolean,
    //     default: false

    // }
  })
</script>

<style scoped>
  .actions {
    padding: 16px;
    background-color: #fafbfc;
    border-radius: 8px;
    box-shadow: 0 2px 12px 0 rgb(0 0 0 / 10%);
  }
</style>
